<template>
  <!-- 单元格组件 -->
  <van-cell :title="articleItem.title" class="art_item van-multi-ellipsis--l2">
    <!-- 默认插槽里面放置的内容在单元格的右上角 -->
    <van-image
      class="right_img"
      v-if="articleItem.cover.type === 1"
      :src="articleItem.cover.images[0]"
    />
    <!-- label插槽的内容在标题下方 -->
    <div slot="label">
      <div class="imgs" v-if="articleItem.cover.type === 3">
        <van-image
          v-for="(item,inx) in articleItem.cover.images"
          :key="inx"
          :src="item"
        />
      </div>
      <div class="text">
        <span>{{articleItem.aut_name}}</span>
        <span>{{articleItem.collect_count}}评论</span>
        <span>{{articleItem.pubdate | relativeTime}}</span>
      </div>
    </div>
  </van-cell>
</template>

<script>
export default {
  props: {
    articleItem: {
      type: Object,
      required: true
    }
  }
}
</script>

<style scoped lang="less">
.art_item {
  .van-cell__value {
    flex: unset;
  }

  .right_img {
    width: 232px;
    height: 146px;
  }

  .imgs {
    display: flex;
    height: 146px;
    img {
        flex: 1;
    }
  }

  .text span {
      margin-right: 20px;
  }
}
</style>
